//
//  AddYunDanSuccessVC.m
//  ReceiptDelivery
//
//  Created by 吕晶 on 2020/9/18.
//  Copyright © 2020 吕晶. All rights reserved.
//

#import "AddYunDanSuccessVC.h"
#import "WoFaYunDetailVC.h"

@interface AddYunDanSuccessVC ()

@end

@implementation AddYunDanSuccessVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"新建运单";
    [self configUI];
}

- (void)configUI {
    self.view.backgroundColor = HexColor(0xffffff);
    UIImageView *iconImgView = [[UIImageView alloc] initWithFrame:CGRectMake((ScreenW - 60) * 0.5, 90, 60, 60)];
    iconImgView.image = [UIImage imageNamed:@"icon_submit_success"];
    [self.view addSubview:iconImgView];
    
    UILabel *titleLab = [[UILabel alloc] initWithFrame:CGRectMake(0, iconImgView.nim_bottom + 30, ScreenW, 32)];
    titleLab.font = BoldFontOfSize(30);
    titleLab.text = @"提交成功";
    titleLab.textAlignment = NSTextAlignmentCenter;
    titleLab.textColor = HexColor(0x2B2C44);
    [self.view addSubview:titleLab];
    
    UILabel *descLab = [[UILabel alloc] initWithFrame:CGRectMake((ScreenW - 200) * 0.5, titleLab.nim_bottom + 20, 200, 40)];
    descLab.numberOfLines = 2;
    descLab.textColor = HexColor(0x585974);
    descLab.textAlignment = NSTextAlignmentCenter;
    descLab.text = @"第三方物流公司正在审核中，请及时关注平台通知。";
    descLab.font = [UIFont systemFontOfSize:14];
    [self.view addSubview:descLab];
    
    UIButton *detailBtn = [[UIButton alloc] initWithFrame:CGRectMake((ScreenW - 295) * 0.5, descLab.nim_bottom + 30, 295, 40)];
    detailBtn.backgroundColor = Color_ThemeColor;
    [detailBtn setTitle:@"查看运单详情" forState:0];
    [detailBtn setTitleColor:HexColor(0xffffff) forState:0];
    detailBtn.titleLabel.font = BoldFontOfSize(16);
    detailBtn.layer.masksToBounds = YES;
    detailBtn.layer.cornerRadius = 6;
    [detailBtn addTarget:self action:@selector(goToDetail) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:detailBtn];
    
    UIButton *backBtn = [[UIButton alloc] initWithFrame:CGRectMake((ScreenW - 295) * 0.5, detailBtn.nim_bottom + 20, 295, 40)];
    backBtn.backgroundColor = HexColor(0xffffff);
    [backBtn setTitle:@"返回首页" forState:0];
    [backBtn setTitleColor:HexColor(0x2B2C44) forState:0];
    backBtn.titleLabel.font = BoldFontOfSize(16);
    backBtn.layer.masksToBounds = YES;
    backBtn.layer.cornerRadius = 6;
    backBtn.layer.borderWidth = 2;
    backBtn.layer.borderColor = HexColor(0xF2F2F5).CGColor;
    [backBtn addTarget:self action:@selector(backToHome) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:backBtn];
}

- (void)goToDetail {
    [self.rt_navigationController popToRootViewControllerAnimated:NO];
    WoFaYunDetailVC *vc = [WoFaYunDetailVC new];
    vc.wa_id = self.dp_id;
    vc.hidesBottomBarWhenPushed = YES;
    [[FactoryMethod getCurrentVC].rt_navigationController pushViewController:vc animated:YES];
}

- (void)backToHome {
    [self.rt_navigationController popToRootViewControllerAnimated:YES];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
